# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=squashfs-tools
pkgver=4.4
pkgrel=0
pkgdesc="Tools for squashfs, a highly compressed read-only filesystem for Linux."
url="https://github.com/plougher/squashfs-tools"
arch="all"
license="GPL"
makedepends="zlib-dev xz-dev lzo-dev lz4-dev attr-dev zstd-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/plougher/squashfs-tools/archive/$pkgver.tar.gz
	fix-compat.patch
"

_builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"/$pkgname
	CFLAGS="$CFLAGS -std=gnu89" \
	make XZ_SUPPORT=1 LZO_SUPPORT=1 LZ4_SUPPORT=1 ZSTD_SUPPORT=1
}

package() {
	cd "$builddir"/$pkgname
	mkdir -p "$pkgdir"/sbin
	cp -a mksquashfs unsquashfs "$pkgdir"/sbin
}
sha512sums="133ce437fb8c929933d52cff710b61dd9181f6f8be58250b0d6a59a7bb79a2b350f68f456b06a0e17c469409a71272d586802d570248273ddcd5dad088c00308  squashfs-tools-4.4.tar.gz
157379cf4bafb72d717f14b1bc5dc350c97a9e68a7018e0febba4b1e59f9fd90c1de8485c4ffc48a035b53be8c3aa62046281291664bee4699100cec637b0bfa  fix-compat.patch"
